package com.situ.springboot.test;

import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.Map;

public class Demo {
    public void waitForSignal(){
        Object obj=new Object();
        synchronized(Thread.currentThread()){
            try {
                obj.wait();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            obj.notify();
        }
    }

    public static void main(String[] args) {
        String str = "192.156.6.7";
        String[] split = str.split("\\.");
        for (String s : split) {
            System.out.println(s);
        }
        Integer integer = new Integer(20);
        int a = integer.intValue();
        int a1 = (int)integer;
        int sum = 23 + integer;
    }

    public void test2() {
        // 默认等价于： Map<String, String> map = new HashMap<>(16, 0.75f);
        Map<String, String> map = new HashMap<>();
    }

    @Test
    public void test44() {
        //情景1
        Integer c = 128;
        Integer d = 128;
        System.out.println(c == d);//false

        //情景2
        Integer a = 1;
        Integer b = 1;
        System.out.println(a == b);//true。 b.intValue()

        //情景3
        Integer e = new Integer(1);
        Integer f = new Integer(1);
        System.out.println(e == f);//false
    }

    @Test
    public void test33() {
        //情景4
        int a = 1;
        Integer b = Integer.valueOf(1);
        Integer c = new Integer(1);

        System.out.println(a == b);//true
        System.out.println(a == c);//true
    }
}
